<template>
  <div class="my-music">
    <div class="top">
      <p>我的音乐</p>
    </div>
    <div class="bottom">
      <div class="bottom-content">
        <div class="box-item" v-for="(item,index) in item" :key="index"
          @click="itemClick(index)">
          <p class="box-top">推荐</p>
          <img :src="item.pic" alt="">
          <p class="box-middle">{{item.font}}</p>
          <p class="box-bottom">{{item.title}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
    export default {
        name: "MyMusic",
        data(){
            return{
                item:[
                    {
                        pic:require('../../../assets/img/profile/love.svg'),
                        font:'我喜欢的音乐',
                        title:'心动模式',
                        path:'/MyLikeMusic'
                    },
                    {
                        pic:require('../../../assets/img/profile/fm.svg'),
                        font:'你的私人曲库',
                        title:'私人FM'
                    },
                    {
                        pic:require('../../../assets/img/profile/js.svg'),
                        font:'最IN爵士乐',
                        title:'爵士电台'
                    },
                    {
                        pic:require('../../../assets/img/profile/car.svg'),
                        font:'开车也能安全听音乐',
                        title:'驾驶模式'
                    },
                    {
                        pic:require('../../../assets/img/profile/book.svg'),
                        font:'聆听那些经典歌曲',
                        title:'云村正能量'
                    },
                ]
            }
        },
        methods:{
            itemClick(index){
                this.$router.push(this.item[index].path)
            },
        }
    }
</script>

<style scoped>
  .my-music{
    width: 100%;
    position: absolute;

    background-color: white;
    border-radius: 15px 15px 0 0;
    z-index: 1;
  }

  .top{
    line-height: 40px;
  }

  .top p{
    margin-left: 20px;
    font-size: 14px;
    font-weight: 500;
  }

  .bottom{
    font-size: 12px;
  }

  .bottom-content{
    display: flex;
    overflow: scroll;
    text-align: center;
    margin-left: 5px;
  }

  ::-webkit-scrollbar {
    display: none;
  }

  .box-item{
    flex: 1;
    background-color: #e5e5e6;
    margin-right: 5px;
    margin-left: 5px;
    height: 150px;
    border-radius: 10px;
    text-align: center;
    position: relative;
  }

  .box-item p{
    width: 110px;
  }

  .box-item img{
    margin-top: 30%;
  }

  .box-top{
    margin-top: 8px;
    letter-spacing: 5px;
    text-align: center;
  }

  .box-middle{
    margin-top: 10px;
  }

  .box-bottom{
    position: absolute;
    bottom: 5px;
  }

  .box-item img{
    width: 20px;
    height: 20px;
  }

</style>